#include <pthread.h>
#include <iostream>
#include <unistd.h>

void *func(void *argv)
{
    while (true)
    {
        std::cout << "I am func pthread,my pid :" << getpid() << std::endl;
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    int i = 100;
    pthread_create(&tid, nullptr, func, (void *)i);

    while (true)
    {
        std::cout << "I am main pthread,my pid :" << getpid() << std::endl;
        sleep(1);
    }
    return 0;
}
